<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Acceso al sistema</title>
</h:head>
<h:body>
	<h:form id="form" rendered="#{sesionBean.sesionActiva()}">
		<div align="center">
			<h:panelGrid columns="2" styleClass="fondo"
				style="text-align:center;">
				<h:panelGroup style="display:block; text-align:left">
					<p:graphicImage value="/img/ui/images.jpg"
						style="height: 100px; width: 210px" />
				</h:panelGroup>

				<h:panelGroup style="display:block; text-align:right">
					<p:graphicImage value="/img/ui/izq.png"
						style="height: 100px; width: 608px" />
				</h:panelGroup>
			</h:panelGrid>
		</div>

		<p:panel header="Acceso al sistema" style="width:100%;">
			<div align="center">
				<h:panelGrid columns="2" cellpadding="20">
					<h:panelGrid style="text-align:right;">
						<p:graphicImage value="/img/aprendizaje.jpg"
							style="height: 295px; width: 460px" />
					</h:panelGrid>

					<h:panelGrid>
						<h:panelGrid columns="2" cellpadding="2">
							<h:outputLabel for="username" value="Usuario: " />
							<p:inputText value="#{sesionBean.user}" id="username"
								required="true" label="username" />

							<h:outputLabel for="password" value="Contraseña: " />
							<p:password value="#{sesionBean.pass}" id="password"
								required="true" label="password" />

							<p:commandButton id="loginButton" value="Iniciar" update="growl"
								action="#{sesionBean.iniciarSesion()}" />

						</h:panelGrid>
						<p:growl id="growl" showDetail="true" life="3000" />
					</h:panelGrid>
				</h:panelGrid>
			</div>
		</p:panel>
	</h:form>
</h:body>
</html>

